import os,csv,fnmatch

fileList=os.listdir('/root/hearst')
os.chdir('/root/hearst')
dataFiles=[]
for file in fileList:
   if fnmatch.fnmatch(file,'Model*csv'):
        dataFiles.append(open(file,'r'))
del fileList

newModel=open('newModeling.csv','w')
newModel.write(dataFiles[0].readline())

for file in dataFiles[1:len(dataFiles)+1]:
   thrwHdr=file.readline()
del thrwHdr

for file in dataFiles:
    for row in file:
        newModel.write(row)
    file.close()

newModel.close()

